<meta charset="utf-8">
<div class="box box-primary" id="pmpTasks_edit">
	<form role="form" id="editForm">
	
		<div class="box box_body">
		
			<div class="row">
			
			    <div class="col-lg-1"></div>
			
				<div class="col-lg-5">
				
					<div class="form-group">
						<label for="title">任务名称</label> 
						<input type="text" name="taskName" v-model="pmpTasks.taskName" class="form-control" id="taskName" required />
					</div>
					
					<div class="form-group">
						<label for="title">评估时间(分钟)</label>
						<input type="text" name="assignHours" v-model="pmpTasks.assignHours" class="form-control" id="assignHours"/>
					</div>
					
					<div class="form-group">
						<label for="title">截止时间</label>  
						<div class='input-group date' id='datetimepicker'> 
                             <input type='text' class="form-control" id="expiryTime" v-model="pmpTasks.expiryTime" /> 
                             <span class="input-group-addon"> 
                                  <span class="glyphicon glyphicon-calendar"></span> 
                             </span> 
                       </div>
                   </div>
					
					<div class="form-group">
						<label for="title">任务负责人</label> 
						<select type="text" name="chargeUserId" class="form-control" id="chargeUserId" v-model="pmpTasks.chargeUserId"
							v-kselect="{url:'/pmp/service/ma/pmpCloudMember/loadCloudMemberComboboVo',vmodel:'pmpTasks.chargeUserId',firstEmpty:'true'}">
						</select>
					</div>
				</div><!-- /.col-lg-5 -->
				
 

				<div class="col-lg-5">
				   
				   
				   <div class="form-group">
						<label for="title">难度系数</label>
						 <select id="difficultyScoreId" name="difficultyScoreId" v-model="pmpTasks.difficultyScoreId" class=" form-control"
							v-kselect="{url:'/pmp/service/pub/pmpALine/loadDifScoreComboboVo',vmodel:'pmpTasks.difficultyScoreId',firstEmpty:'true'}">
						</select>
					</div>
					
					<div class="form-group">
						<label for="title"> 优先级</label> 
						<select v-model="pmpTasks.priority" id="priority" name="priority" class="form-control" required>
							<option value="1">低</option>
							<option value="2">中等</option>
							<option value="3">急</option>
							<option value="4">加急</option>
						</select>
					</div>
					
					<div class="form-group">
						<label for="title">来源于需求</label> 
						<div class="radio">
						   <label>
						      <input type="radio" id="fromRequire1" name="fromRequire" v-model="pmpTasks.fromRequire"  value="1" >是</label>  
						   <label >
						      <input type="radio" id="fromRequire2" name="fromRequire" v-model="pmpTasks.fromRequire"  value="2" check >否</label>
					    </div>
					</div>
					
					<div class="form-group">
						<label for="title"> 来源需求</label>
					    <select  id="requireId" name="requireId"  v-model="pmpTasks.requireId" class=" form-control" draggable="false"
							v-kselect="{url:'/pmp/service/pub/pmpRequires/loadPmpRequiresComboboVo',vmodel:'pmpTasks.requireId',firstEmpty:'true'}">
						</select>
					</div>	
					
				</div><!-- /.col-lg-5 -->
				
				
		</div><!-- /.row -->
			

		
		<div class="row">
		
		<div class="col-lg-1"></div>
		
		<div class="col-lg-10">
		   <div class="form-group">
				<label for="title">任务详情</label>
				<textarea rows="" cols="" name="taskDetail" v-model="pmpTasks.taskDetail" class="form-control" id="taskDetail" required>
				</textarea>
			</div>
		</div>
		</div><!-- /.row -->
     
     </div><!-- /.box-body -->
		<div class="box-footer">
			<button type="button" class="btn btn-default" v-on:click="cancle">取消</button>
			<button type="button" class="btn btn-info pull-right" v-on:click="update">提交</button>
		</div>
		
	</form>
</div>
<script type="text/javascript">
		var news = new Vue({
			el : '#pmpTasks_edit',
			data : {
				pmpTasks : {
					projectId : null,
					projectVersionId : null,
					taskName : null,
					taskDetail : null,
					fromRequire : null,
					requireId : null,
					chargeUserId : null,
					assignHours : null,
					difficultyScoreId : null,
					priority : null,
					expiryTime : null
				},
				bus : new Vue(),
			},
			mounted : function() {
				var _this = this;
				var param = zfesLayerEditDg.getLayerParam();//任务id 
				var url = "/pmp/service/pub/pmpTasks/loadPmpTasks";
				zfesAjax.ajaxTodo(url, param, function(data) {
					_this.$data.pmpTasks = data.data.pmpTasks;
				})
			},
			methods : {
				update : function() {
					if ($("#editForm").valid()) {
						let _this = this;
						let url = "/pmp/service/pm/pmpTasks/updatePmpTasks";
						zfesAjax.ajaxTodo(url, _this.$data.pmpTasks, function(
								data) {
							alertSwal.successText(data.message);
							layer.close(layer.index);
						})
					}
				},
				cancle : function() {
					layer.close(layer.index);
				}
			}
		});
</script>
